from __future__ import division
import numpy as np
import math

print "importing numpy"




def normalize_columns(arr):
    rows, cols = arr.shape
    for col in xrange(cols):
        arr[:,col] = arr[:,col]/abs(arr[:,col]).max()
        
def magnitude(v):
    return math.sqrt(sum(v[i]*v[i] for i in range(len(v))))

def add(u, v):
    return [ u[i]+v[i] for i in range(len(u)) ]

def sub(u, v):
    return [ u[i]-v[i] for i in range(len(u)) ]

def dot(u, v):
    return sum(u[i]*v[i] for i in range(len(u)))

def normalize(v):
    vmag = magnitude(v)
    return [ v[i]/vmag  for i in range(len(v)) ]
print 'creating arrays'


def uniq(input):
  output = []
  for x in input:
    if x not in output:
      output.append(x)
  return output


zeroArray=np.zeros((2,3))
oneArray=np.ones((2,3))

emptyArray=np.empty((2,3))


foo = [[1,2,3],
       [4,5,6]]

myArray=np.array(foo)


A=np.arange(50,100).reshape((10,5))

mu = (A[:,1:2]).mean()
print A[:,1:2]
normalize_columns(A[:,1:2])

print A[:,1:2]
